<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>渐变</title>
    <style>
        .linear {
            width: 400px;
            height: 400px;
            border: 1px solid #000;
            margin: 100px auto;
            background-image: linear-gradient(red, yellow);
            background-image: linear-gradient(to right, red, yellow);
            background-image: linear-gradient(45deg, red, yellow);
            /* 透明 transparent*/
            background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.4));
        }

        .radial {
            width: 400px;
            height: 400px;
            border: 1px solid #000;
            margin: 100px auto;
            background-image: radial-gradient(red, yellow);
            /* 
                半径 at 圆心位置,
                颜色,
                颜色
            */
            /* 一条半径是一个圆,两条半径是一个椭圆 */
            background-image: radial-gradient(50px at center center, red, yellow);
            background-image: radial-gradient(50px 20px at center center, red, yellow);
        }

        .btn {
            display: block;
            width: 200px;
            height: 200px;
            margin: 100px auto;
            cursor: pointer;
            background-image: radial-gradient(blue, rgb(255, 255, 255));
        }
    </style>
</head>

<body>
    <div class="linear">线性渐变</div>
    <div class="radial">径向渐变</div>
    <button class="btn">按钮</button>
</body>

</html>